package com.xjust.controller;

import com.xjust.pojo.Prescription;
import com.xjust.pojo.Result;
import com.xjust.service.PrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/prescriptions")
public class PrescriptionController {
    //保存开药信息
    @Autowired
    PrescriptionService prescriptionService;
    @PostMapping("/insertPrescription")
    public Result insertPrescription(@RequestBody List<Map<String,Object>> prescription){
        prescriptionService.insertPrescription(prescription);
        return Result.success();

    }
}
